package com.moyuxi.sound_of_the_forest.ui.pages.musicClassify

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import com.moyuxi.sound_of_the_forest.entity.LocalMusicBean
import com.moyuxi.sound_of_the_forest.ui.compose.SongListCompose


@Composable
fun MusicListFrameCompose(
    data:List<LocalMusicBean>,
    navToScanMusic: ()->Unit,
    playingAllClick: (List<LocalMusicBean>) -> Unit,
    playingInBean: (LocalMusicBean) -> Unit,
    addToPlayingList: (LocalMusicBean) -> Unit,
    removeFromDataList: (LocalMusicBean) -> Unit
) {//中间列表内容
    if (data.isEmpty()) {// 没有数据就去扫描
        Column(modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {
            Button(onClick = { navToScanMusic.invoke() }) { Text(text = "扫描歌曲") }
        }
    } else {// 有数据就显示歌曲列表
        SongListCompose(data, playingAllClick, playingInBean, addToPlayingList, removeFromDataList)
    }
}